package cn.edu.zut.request;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author Davey chan
 */
/*这里是匹配有四种方式
urlpattern:
1，精确匹配：@WebServlet("/demo3/haha")
2，目录匹配:@WebServlet("/demo3/*")
3，拓展名匹配:@WebServlet("*.do"),与带.do的文件来匹配
4，任意匹配：@WebServlet("/")
*/
@WebServlet("/demo3/haha")
public class Servletdemo3 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("get...");
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("post...");
    }
}
